<%@ page import="java.util.Locale" %>
<%@ page import="java.util.ResourceBundle" %><%--
  Created by IntelliJ IDEA.
  User: WuLiangHang
  Date: 2021/11/14
  Time: 13:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //从请求头中获取Locale信息
    Locale locale = request.getLocale();
    System.out.println(locale);
    //根据baseName 和 Locale对象信息 对配置文件进行读取
    ResourceBundle bundle = ResourceBundle.getBundle("i18n", locale);
%>
<a href="">中文</a>
<a href="">english</a>
<html>
<head>
    <title><%=bundle.getString("login_page")%>
    </title>
</head>
<body>
<h1><%=bundle.getString("login")%>
</h1>
<%=bundle.getString("username")%>：<input type="text" name="username"><br>
<%=bundle.getString("password")%>：<input type="password" name="password"><br>
<button><%=bundle.getString("login")%>
</button>
</body>
</html>
